package com.foreknow.demo12.exer;

import java.util.HashMap;
import java.util.Iterator;

/**
 * @author shkstart
 * @create 2021-08-04 8:46
 */
public class Main {
    public static void main(String[] args) {
        StringSameCount ssc = new StringSameCount();
        ssc.hashInsert("ab");
        ssc.hashInsert("ac");
        ssc.hashInsert("acd");
        ssc.hashInsert("acd");
        ssc.hashInsert("asc");
        ssc.hashInsert("afc");
        ssc.hashInsert("avc");
        ssc.hashInsert("ac");
        HashMap map = ssc.getHashMap();
        Iterator it = map.keySet().iterator();
        String temp;
        while (it.hasNext()) {
            temp = (String)it.next();
            System.out.println(temp+"出现了"+map.get(temp)+"次");
        }
        System.out.println(map);
    }
}
